<?
    if($this->session->userdata('pickup_date'))
        $ispost = TRUE;
?>
<div style="margin-top: 43px;"></div>

<div class="location-0" id="content">
    <div id="content-box">

        <div class="work">
            <div class="location loc-1">

                <div class="vcard" id="car-detail">
                    <div class="image-box left">
                        <?if(isset($images[0]->url)){?>
                            <a rel="lightbox" title="<?=$car[0]->name?>" href="<?=$info_sis_url.$images[0]->url?>_800_600.jpg">

                                <img alt="<?=$car[0]->name?>" class="photo" src="<?=$info_sis_url.$images[0]->url?>_210_151.jpg" width="210">

                            </a>
                            <?}else echo 'No image';?>

                    </div>
                    <div class="box-right item">
                        <div class="item">    
                            <h2 class="fn"><?=$car[0]->name?></h2>
                        </div>

                        <!-- vlastnosti - sedy box -->
                        <div class="itemCar-properties">
                            <ul class="clean-list">

                                <li title="Seat count" class="param-seatCount">
                                    <div class="param-title">seat count: </div>
                                    <div class="param-int"><?=$car[0]->seat_count?></div>
                                </li>

                                <li title="Number of doors" class="param-doorCount">
                                    <div class="param-title">Number of doors: </div>
                                    <div class="param-int"><?=$car[0]->num_of_doors?></div>
                                </li>

                                <li title="Luggage space capacity" class="param-bootCapacity">
                                    <div class="param-title">luggage space capacity: </div>
                                    <div class="param-int"><?=$car[0]->luggage_capacity?></div>
                                </li>

                                <li title="A/T" class="param-autoTransmission">
                                    <div class="param-title">A/T: </div>
                                    <?if($car[0]->auto_transmission){?>
                                        <div class="param-boolean-true"><span>yes</span></div>
                                        <?}else{?>
                                        <div class="param-boolean-false"><span>no</span></div>   
                                        <?}?>
                                </li>

                                <li title="A/C" class="param-airCondition">
                                    <div class="param-title">A/C: </div>
                                    <?if($car[0]->ac){?>
                                        <div class="param-boolean-true"><span>yes</span></div>
                                        <?}else{?>
                                        <div class="param-boolean-false"><span>no</span></div>   
                                        <?}?>
                                </li>

                                <li title="Benzin" class="param-fuel last">
                                    <div class="param-title">A/C: </div>
                                    <?if($car[0]->diesel){?>
                                        <div class="param-fuel"><span>D</span></div>
                                        <?}else{?>
                                        <div class="param-fuel"><span>B</span></div>   
                                        <?}?>

                                </li>

                            </ul>
                        </div>
                        <table class="clean-table car-detail-table">
                            <tbody><tr>
                                    <td>

                                        <?
                                            /* FIRST CALCULATE PERCENTAGE --> FORMULA X:100=CUR:TOTAL */                                    

                                            $x= (100*$car[0]->score)/10;

                                        ?>
                                        <div class="itemCar-rating green-text">
                                            <div class="bar">
                                                <div style="width:<?=$x?>%" class="progress-bar"></div>
                                            </div>
                                        </div>



                                        <div class="rating-text green-text" style="text-align: left;">
                                            <strong>

                                                Score <?=$car[0]->score?>

                                            </strong>
                                        </div>

                                    </td>
                                    <td>                                        

                                        <?if(isset($ispost)){?>
                                            <strong class="green-text">Price:</strong><br>
                                            <strong><?=$this->session->userdata('tot_price');?> &euro;</strong>                        
                                            <?}else{?>
                                            &nbsp;
                                            <?}?>

                                    </td>
                                </tr>
                            </tbody></table>

                        <div class="submit right">
                            <div class="submit-end">&nbsp;</div>
                            <?if(isset($ispost)){?>
                                <a title="Book now" href="<?=$url?>step_3?id=<?=$car[0]->id?>">Book now</a>
                                <?}else{?>
                                <a title="Book now" onclick="alert('Please fill in the dates and locations in the form on the left side of this page'); return false;" href="?do%5BsetCar%5D=27&amp;step3=true">Book now</a>
                                <?}?>
                        </div>
                    </div>

                    <div class="hr"></div>

                    <div class="green-box right hreview">
                        <div class="box item">
                            <h3>Bonus equipment &ndash; exclusively with us</h3>
                            <ul>

                                <li><b>GPS Navigation</b></li>

                            </ul>
                        </div>
                    </div>

                    <strong class="itemCar-parameterText">engine</strong>: <?=$car[0]->engine?><br>
                    <strong class="itemCar-parameterText">max power</strong>: <?=$car[0]->maxpower?><br>

                    <strong class="itemCar-parameterText">maximal speed</strong>: <?=$car[0]->maxspeed?>km/h<br>
                    <strong class="itemCar-parameterText">consumption</strong>: <?=number_format($car[0]->fuel_consumption,1,',', ' ')?>l/100km<br>
                    <strong class="itemCar-parameterText">transmission</strong>: 
                    <?
                        if($car[0]->auto_transmission){
                            echo 'automatic';
                        }else echo 'manual';
                    ?>
                    <br>




                    <strong class="itemCar-parameterText">luggage space capacity</strong>:<?=$car[0]->luggage_capacity?>l<br>



                    <!-- ANOTATION -->
                    <h3 style="margin-top: 13px;">Vehicle description</h3>
                    <div class="annotation">
                        <p style="text-align: justify;"><?=$car[0]->equipment?></p>
                    </div>


                    <!-- GALLERY -->
                    <div class="hr"></div>
                    <div class="gallery">
                        <h3>Gallery</h3>
                        <ul class="items">

                            <?
                                if (isset($images)){
                                    $skip = FALSE;
                                    foreach($images as $image):
                                        //skip first
                                        if(!$skip){
                                            $skip = TRUE;                                          
                                        }else{

                                        ?>
                                        <li class="item">
                                            <div class="item-image">
                                                <a rel="lightbox" title="<?=$car[0]->name?>" href="<?=$info_sis_url.$image->url?>_800_600.jpg" >
                                                    <img alt="car_<?=$car[0]->name;?>" src="<?=$info_sis_url.$image->url?>_210_151.jpg" width="188">
                                                </a>
                                            </div>
                                        </li>
                                        <?}
                                        endforeach;
                                }else echo 'No images';
                            ?>

                        </ul>
                    </div>

                    <!-- VIDEO  -->

                    <div class="hr"></div>
                    <h3>Video</h3>
                    <div class="youtube">
                        <?if (isset($video)){?>
                            <iframe width="640" height="390" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/<?=$video[0]->url?>?rel=0&amp;wmode=transparent" type="text/html" class="youtube-player" title="YouTube video player"></iframe>
                            <?}else echo 'No video.';?>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<?if(isset($ispost)){?>

    <div class="location-0" id="column">

        <form id="formReservationBasicData" method="post" action="<?=$url?>getCarQuote">

        <div id="formReservationBasicDatahPreview" class="fieldset formReservationBasicDatahPreview">
            <fieldset>
                <legend style="background-color: #FFF;"><span>Your details</span></legend>

                <div class="fieldset-box" style="padding-bottom: 0;">

                    <dl class="formitem- formitem">
                        <dt>
                            <label class="element" for="">&nbsp;</label> 
                        </dt>
                        <dd>
                            <table width="100%" border="0" class="clean-tab">
                                <tbody>
                                    <tr>
                                        <td valign="top">
                                            <h4>Pick up</h4>
                                            <ul class="clean-list" id="fromData">
                                                <li><?=$this->session->userdata('pickup_loc_text')?></li>                          
                                                <li> <?=$this->session->userdata('pickup_date').', '.$this->session->userdata('fullfrom');?> h</li>
                                            </ul>
                                        </td>
                                        <td valign="top">
                                            <h4>Return</h4>
                                            <ul class="clean-list" id="destData">
                                                <li><?=$this->session->userdata('return_loc_text')?></li>
                                                <li><?=$this->session->userdata('return_date').', '.$this->session->userdata('fullto');?> h </li>
                                            </ul>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </dd>
                    </dl>
                    <dl class="formitem- formitem" style="margin-bottom: 13px;">
                        <dt><label class="element" for="">&nbsp;</label> </dt>
                        <dd>
                            <div>
                                <a onclick="
                                    $('#formReservationBasicDatahPreview').slideUp({duration:500,easing:'easeOutSine',
                                    complete:function(){
                                    $('#formReservationBasicDatah1').slideDown({duration:500,easing:'easeOutSine',
                                    complete:function(){
                                    $('#formReservationBasicDatah2').slideDown({duration:500,easing:'easeOutSine',
                                    complete:function(){
                                    $('#formReservationBasicDatah3').slideDown({duration:500,easing:'easeOutSine',
                                    complete:function(){
                                    }})
                                    }})
                                    }})
                                    }                                    
                                    });
                                    " href="#">Change details</a>
                            </div>
                        </dd>
                    </dl>

                </div>
            </fieldset>
        </div>

        <div id="formReservationBasicDatah1" class="fieldset formReservationBasicDatah1" style="display: none;">
            <fieldset>
                <legend style="background-color: #FFF;"><span>Pick up</span></legend>
                <div class="fieldset-box">

                    <dl class="formitem-fromBranch formitem">
                        <dt><label class="element" for="fromBranch">Pick up</label> </dt>
                        <dd>

                            <select name="pickup_loc_id" id="pickup_loc_id">
                                <optgroup label="Budva">
                                    <option value="1" selected="selected">Globtour Office</option>
                                    <option value="2">Hotel Avala</option>
                                    <option value="3">Hotel Slovenska Plaza</option>
                                    <option value="4">Hotel Mediteran</option>
                                    <option value="5">Hotel Iberostar</option>
                                </optgroup>
                                <optgroup label="Tivat">
                                    <option value="6">Airport +15&euro;</option>
                                    <option value="7">Hotel Palma +15&euro;</option>
                                </optgroup>
                                <optgroup label="Bar">
                                    <option value="8">Hotel Princess +15&euro;</option>
                                </optgroup>
                                <optgroup label="Ulcinj">
                                    <option value="9">Hotel Otrant +15&euro;</option>
                                    <option value="10">Hotel Ada Bojana +15&euro;</option>
                                </optgroup>
                                <optgroup label="Podgorica">
                                    <option value="11">Airport +15&euro;</option>
                                    <option value="12">Hotel Crna Gora +15&euro;</option>
                                    <option value="13">Hotel Podgorica +15&euro;</option>
                                </optgroup>
                            </select>


                        </dd>
                    </dl>
                    <dl class="formitem-fromDateGrp formitem">
                        <dt><label class="element">From</label> </dt>
                        <dd>
                            <input type="text" class="text" name="datefrom" id="datefrom" size="29" disabled="disabled"/>
                        </dd>
                    </dl>

                    <dl class="formitem-fromTimeGrp formitem">
                    <dt><label class="element">Time</label> </dt>
                    <dd>
                        <? echo makefull('fullfrom',15,'id="fullfrom" class="dd"'); ?>
                    </dd>

                </div>
            </fieldset>
        </div>

        <div id="formReservationBasicDatah2" class="fieldset formReservationBasicDatah2" style="display: none;">
            <fieldset>
                <legend><span>Return</span></legend>

                <div class="fieldset-box">

                    <dl class="formitem-destBranch formitem">
                        <dt><label class="element" for="destBranch">Return</label> </dt>

                        <dd>
                            <select name="return_loc_id" id="return_loc_id">
                                <optgroup label="Budva">
                                    <option value="1" selected="selected">Globtour Office</option>
                                    <option value="2">Hotel Avala</option>
                                    <option value="3">Hotel Slovenska Plaza</option>
                                    <option value="4">Hotel Mediteran</option>
                                    <option value="5">Hotel Iberostar</option>
                                </optgroup>
                                <optgroup label="Tivat">
                                    <option value="6">Airport +15&euro;</option>
                                    <option value="7">Hotel Palma +15&euro;</option>
                                </optgroup>
                                <optgroup label="Bar">
                                    <option value="8">Hotel Princess +15&euro;</option>
                                </optgroup>
                                <optgroup label="Ulcinj">
                                    <option value="9">Hotel Otrant +15&euro;</option>
                                    <option value="10">Hotel Ada Bojana +15&euro;</option>
                                </optgroup>
                                <optgroup label="Podgorica">
                                    <option value="11">Airport +15&euro;</option>
                                    <option value="12">Hotel Crna Gora +15&euro;</option>
                                    <option value="13">Hotel Podgorica +15&euro;</option>
                                </optgroup>
                            </select>

                        </dd>


                    </dl>

                    <dl class="formitem-fromDateGrp formitem">
                        <dt><label class="element">To</label> </dt>
                        <dd>
                            <input type="text" class="text" name="dateto" id="dateto" size="29" disabled="disabled"/>
                        </dd>
                    </dl>

                    <dl class="formitem-fromTimeGrp formitem">
                        <dt><label class="element">Time</label> </dt>
                        <dd>
                            <? echo makefull('fullto',15,'id="fullto" class="dd"'); ?>
                        </dd>

                    </dl>

                </div>
            </fieldset>
        </div>

        <div id="formReservationBasicDatah3" class="fieldset formReservationBasicDatah3" style="display: none;">
            <fieldset>
                <legend><span>Continue</span></legend>

                <input type="hidden" name="carid" value="<?=$car[0]->id?>" />
                <input type="hidden" name="pickup_date" id="pickup_date">
                <input type="hidden" name="return_date" id="return_date">

                <div class="fieldset-box">
                    <dl class="formitem-formReservationBasicDataSubmit formitem">
                        <dt><label class="element" for="formReservationBasicDataSubmit">&nbsp;</label> </dt>

                        <dd><input type="submit" value="Change details" name="formReservationBasicDataSubmit" id="formReservationBasicDataSubmit" class="submit"></dd>
                    </dl>                            

                </div>
            </fieldset>
        </div>

    </div>

    <style>
        .dd {
            margin-bottom: 0;
        }
        .dd .ddTitle{
            width: 120px;
        }
        .dd .ddChild {
            width: 120px !important;
        }
    </style>

    <script type="text/javascript">
        $(function(){
            function init_app(){
                /***********************************************************
                * JQUERY UI Calendar with event
                ***********************************************************/

                var date = new Date();    

                //  limiter 1 WEBSITE PICUP DATE - today is not available
                //  limiter 0 SYSTEM PICUP DATE - today is available
                var limiter = 1;

                if(typeof(user_name) != "undefined"){
                    limiter = 0;   
                }

                var m = date.getMonth(),
                d = date.getDate() + limiter,
                y = date.getFullYear();

                img_url = base_url+'assets/img/backgnds/calendar.png';
                // Disable all dates till today
                $('#datefrom').datepicker({
                    minDate: new Date(y, m, d),
                    dateFormat: 'dd.mm.yy',
                    showOn: 'button',
                    buttonImage: img_url,
                    buttonImageOnly: true,
                    onSelect: function(dateStr) {

                        var depart = $.datepicker.parseDate('dd.mm.yy', dateStr);
                        depart.setDate(depart.getDate() + limiter);
                        $('#dateto').datepicker("setDate", depart);
                        $('#dateto').datepicker("option", "minDate", depart);

                        $('#pickup_date').val($.datepicker.formatDate('dd.mm.yy', $('#datefrom').datepicker('getDate')));
                        $('#return_date').val($.datepicker.formatDate('dd.mm.yy', $('#dateto').datepicker('getDate')));

                    }
                });

                $('#dateto').datepicker({
                    minDate: new Date(y, m, d),
                    dateFormat: 'dd.mm.yy',
                    showOn: 'button',
                    buttonImage: img_url,
                    buttonImageOnly: true,
                    onSelect: function(dateStr) {
                        $('#return_date').val($.datepicker.formatDate('dd.mm.yy', $('#dateto').datepicker('getDate')));
                    }
                })

                // SET TIME & DATE
                $('#fullfrom').val('08:00');
                $('#fullto').val('08:00');

                $('#datefrom').datepicker('setDate', new Date(y, m, d));
                $('#dateto').datepicker('setDate', new Date(y, m, d+1));

                $('#pickup_date').val($.datepicker.formatDate('dd.mm.yy', $('#datefrom').datepicker('getDate')));
                $('#return_date').val($.datepicker.formatDate('dd.mm.yy', $('#dateto').datepicker('getDate')));


            }
            init_app();    
        })
    </script>

    <script language="javascript">
        $(document).ready(function(e) {
            try {
                $("body select.dd").msDropDown();
            } catch(e) {
                alert(e.message);
            }

            $('#pickup_loc_id').live('change', function(){

                var sID = $('#pickup_loc_id option:selected').val(); 
                var $dd = $('#return_loc_id');
                if ($dd.length > 0) { // make sure we found the select we were looking for

                    // save the selected value
                    var selectedVal = $dd.val();

                    // get the options and loop through them
                    var $options = $('option', $dd);
                    var arrVals = [];
                    $options.each(function(){

                        if($(this).val()==sID||$(this).val()==1||$(this).val()==6||$(this).val()==11){

                            $(this).removeAttr('disabled');

                        }else{
                            $(this).attr('disabled','disabled');
                            //console.log($(this).text())
                            //console.log($(this).val())
                        }
                    });
                }
                $('#return_loc_id').val(sID).trigger('change');


            })

            $('#pickup_loc_id').val(1).trigger('change');

        });
    </script>

    <?}else{?>

    <div class="location-0" id="column">
        <div id="column-box">

            <div class="location loc-1">

                <form id="formReservationBasicData" method="post" action="<?=$url?>getCarQuote">
                    <input type="hidden" value="" name="continue" id="continue">

                    <div id="form-bubble-info" class="bubble-info">
                        <div class="bubble-info-box">
                            <div class="bubble-info-in">
                                <a onclick="$(this).click(function(){$('.bubble-info').hide();})" href="javascript:void(0);" class="bubble-close">×</a>
                                <div class="bubble-text">
                                    To view prices add further information.
                                </div>
                            </div>
                        </div>
                    </div>

                    <div id="formReservationBasicDatah1" class="fieldset formReservationBasicDatah1">
                        <fieldset>
                            <legend style="background-color: #FFF;"><span>Pick up</span></legend>
                            <div class="fieldset-box">

                                <dl class="formitem-fromBranch formitem">
                                    <dt><label class="element" for="fromBranch">Pick up</label> </dt>
                                    <dd>

                                        <select name="pickup_loc_id" id="pickup_loc_id">
                                            <optgroup label="Budva">
                                                <option value="1" selected="selected">Globtour Office</option>
                                                <option value="2">Hotel Avala</option>
                                                <option value="3">Hotel Slovenska Plaza</option>
                                                <option value="4">Hotel Mediteran</option>
                                                <option value="5">Hotel Iberostar</option>
                                            </optgroup>
                                            <optgroup label="Tivat">
                                                <option value="6">Airport +15&euro;</option>
                                                <option value="7">Hotel Palma +15&euro;</option>
                                            </optgroup>
                                            <optgroup label="Bar">
                                                <option value="8">Hotel Princess +15&euro;</option>
                                            </optgroup>
                                            <optgroup label="Ulcinj">
                                                <option value="9">Hotel Otrant +15&euro;</option>
                                                <option value="10">Hotel Ada Bojana +15&euro;</option>
                                            </optgroup>
                                            <optgroup label="Podgorica">
                                                <option value="11">Airport +15&euro;</option>
                                                <option value="12">Hotel Crna Gora +15&euro;</option>
                                                <option value="13">Hotel Podgorica +15&euro;</option>
                                            </optgroup>
                                        </select>


                                    </dd>
                                </dl>
                                <dl class="formitem-fromDateGrp formitem">
                                    <dt><label class="element">From</label> </dt>
                                    <dd>
                                        <input type="text" class="text" name="datefrom" id="datefrom" size="29" disabled="disabled"/>
                                    </dd>
                                </dl>

                                <dl class="formitem-fromTimeGrp formitem">
                                <dt><label class="element">Time</label> </dt>
                                <dd>
                                    <? echo makefull('fullfrom',15,'id="fullfrom" class="dd"'); ?>
                                </dd>

                            </div>
                        </fieldset>
                    </div>

                    <div id="formReservationBasicDatah2" class="fieldset formReservationBasicDatah2">
                        <fieldset>
                            <legend><span>Return</span></legend>

                            <div class="fieldset-box">

                                <dl class="formitem-destBranch formitem">
                                    <dt><label class="element" for="destBranch">Return</label> </dt>

                                    <dd>
                                        <select name="return_loc_id" id="return_loc_id">
                                            <optgroup label="Budva">
                                                <option value="1" selected="selected">Globtour Office</option>
                                                <option value="2">Hotel Avala</option>
                                                <option value="3">Hotel Slovenska Plaza</option>
                                                <option value="4">Hotel Mediteran</option>
                                                <option value="5">Hotel Iberostar</option>
                                            </optgroup>
                                            <optgroup label="Tivat">
                                                <option value="6">Airport +15&euro;</option>
                                                <option value="7">Hotel Palma +15&euro;</option>
                                            </optgroup>
                                            <optgroup label="Bar">
                                                <option value="8">Hotel Princess +15&euro;</option>
                                            </optgroup>
                                            <optgroup label="Ulcinj">
                                                <option value="9">Hotel Otrant +15&euro;</option>
                                                <option value="10">Hotel Ada Bojana +15&euro;</option>
                                            </optgroup>
                                            <optgroup label="Podgorica">
                                                <option value="11">Airport +15&euro;</option>
                                                <option value="12">Hotel Crna Gora +15&euro;</option>
                                                <option value="13">Hotel Podgorica +15&euro;</option>
                                            </optgroup>
                                        </select>

                                    </dd>


                                </dl>

                                <dl class="formitem-fromDateGrp formitem">
                                    <dt><label class="element">To</label> </dt>
                                    <dd>
                                        <input type="text" class="text" name="dateto" id="dateto" size="29" disabled="disabled"/>
                                    </dd>
                                </dl>

                                <dl class="formitem-fromTimeGrp formitem">
                                    <dt><label class="element">Time</label> </dt>
                                    <dd>
                                        <? echo makefull('fullto',15,'id="fullto" class="dd"'); ?>
                                    </dd>

                                </dl>

                            </div>
                        </fieldset>
                    </div>

                    <div id="formReservationBasicDatah3" class="fieldset formReservationBasicDatah3">
                        <fieldset>
                            <legend><span>Continue</span></legend>

                            <input type="hidden" name="carid" value="<?=$car[0]->id?>" />
                            <input type="hidden" name="pickup_date" id="pickup_date">
                            <input type="hidden" name="return_date" id="return_date">

                            <div class="fieldset-box">
                                <dl class="formitem-formReservationBasicDataSubmit formitem">
                                    <dt><label class="element" for="formReservationBasicDataSubmit">&nbsp;</label> </dt>

                                    <dd><input type="submit" value="Get a quote" name="formReservationBasicDataSubmit" id="formReservationBasicDataSubmit" class="submit"></dd>
                                </dl>                            

                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>

        </div> <!-- END #column-box -->
    </div>

    <style>
        .dd {
            margin-bottom: 0;
        }
        .dd .ddTitle{
            width: 120px;
        }
        .dd .ddChild {
            width: 120px !important;
        }
    </style>

    <script type="text/javascript">
        $(function(){
            function init_app(){
                /***********************************************************
                * JQUERY UI Calendar with event
                ***********************************************************/

                var date = new Date();    

                //  limiter 1 WEBSITE PICUP DATE - today is not available
                //  limiter 0 SYSTEM PICUP DATE - today is available
                var limiter = 1;

                if(typeof(user_name) != "undefined"){
                    limiter = 0;   
                }

                var m = date.getMonth(),
                d = date.getDate() + limiter,
                y = date.getFullYear();

                img_url = base_url+'assets/img/backgnds/calendar.png';
                // Disable all dates till today
                $('#datefrom').datepicker({
                    minDate: new Date(y, m, d),
                    dateFormat: 'dd.mm.yy',
                    showOn: 'button',
                    buttonImage: img_url,
                    buttonImageOnly: true,
                    onSelect: function(dateStr) {

                        var depart = $.datepicker.parseDate('dd.mm.yy', dateStr);
                        depart.setDate(depart.getDate() + limiter);
                        $('#dateto').datepicker("setDate", depart);
                        $('#dateto').datepicker("option", "minDate", depart);

                        $('#pickup_date').val($.datepicker.formatDate('dd.mm.yy', $('#datefrom').datepicker('getDate')));
                        $('#return_date').val($.datepicker.formatDate('dd.mm.yy', $('#dateto').datepicker('getDate')));

                    }
                });

                $('#dateto').datepicker({
                    minDate: new Date(y, m, d),
                    dateFormat: 'dd.mm.yy',
                    showOn: 'button',
                    buttonImage: img_url,
                    buttonImageOnly: true,
                    onSelect: function(dateStr) {
                        $('#return_date').val($.datepicker.formatDate('dd.mm.yy', $('#dateto').datepicker('getDate')));
                    }
                })

                // SET TIME & DATE
                $('#fullfrom').val('08:00');
                $('#fullto').val('08:00');

                $('#datefrom').datepicker('setDate', new Date(y, m, d));
                $('#dateto').datepicker('setDate', new Date(y, m, d+1));

                $('#pickup_date').val($.datepicker.formatDate('dd.mm.yy', $('#datefrom').datepicker('getDate')));
                $('#return_date').val($.datepicker.formatDate('dd.mm.yy', $('#dateto').datepicker('getDate')));


            }
            init_app();    
        })
    </script>

    <script language="javascript">
        $(document).ready(function(e) {
            try {
                $("body select.dd").msDropDown();
            } catch(e) {
                alert(e.message);
            }

            $('#pickup_loc_id').live('change', function(){

                var sID = $('#pickup_loc_id option:selected').val(); 
                var $dd = $('#return_loc_id');
                if ($dd.length > 0) { // make sure we found the select we were looking for

                    // save the selected value
                    var selectedVal = $dd.val();

                    // get the options and loop through them
                    var $options = $('option', $dd);
                    var arrVals = [];
                    $options.each(function(){

                        if($(this).val()==sID||$(this).val()==1||$(this).val()==6||$(this).val()==11){

                            $(this).removeAttr('disabled');

                        }else{
                            $(this).attr('disabled','disabled');
                            //console.log($(this).text())
                            //console.log($(this).val())
                        }
                    });
                }
                $('#return_loc_id').val(sID).trigger('change');


            })

            $('#pickup_loc_id').val(1).trigger('change');

        });
    </script>

    <?}?>

<script type="text/javascript">
    $(function() {

        $('a[rel=lightbox]').lightBox({
            overlayBgColor: '#FFF',
            overlayOpacity: 0.6,
            imageLoading: base_url+'assets/img/lightbox/loading.gif',
            imageBtnClose: base_url+'assets/img/lightbox/close.gif',
            imageBtnPrev: base_url+'assets/img/lightbox/prev.gif',
            imageBtnNext: base_url+'assets/img/lightbox/next.gif',
            imageBlank : base_url+'assets/img/lightbox/blank.gif',
            containerResizeSpeed: 350,
            txtImage: 'Image',
            txtOf: 'of'
        });
    });
</script>
